<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<h1>主页</h1>
<p th:text="|你好${user}|"></p>

<div th:unless="${user}">
    <a th:href="@{/login}">登录</a>
</div>
<div th:if="${user}">
    <a th:href="@{/login}">注销</a>
</div>
</body>
</html>